
file(GLOB source_cpp
"${CMAKE_CURRENT_LIST_DIR}/src/*.c*"
)

LIST(APPEND SOURCEFILES 
    ${source_cpp}
)

file(GLOB cl_kernels
"${CMAKE_CURRENT_LIST_DIR}/opencl/*.cl"
)

set(name  "my_algo_gpu")
set(OCL_NAME "my_algo_gpu")
add_custom_command(
      OUTPUT "${CMAKE_CURRENT_LIST_DIR}/src/${OCL_NAME}.cpp"  # don't add .hpp file here to optimize build process
      COMMAND ${CMAKE_COMMAND} "-DMODULE_NAME=${name}" "-DCL_DIR=${CMAKE_CURRENT_LIST_DIR}/opencl" "-DOUTPUT=${CMAKE_CURRENT_LIST_DIR}/src/${OCL_NAME}.cpp" -P "${CMAKE_CURRENT_LIST_DIR}/cl2cpp.cmake"      
      COMMENT "Processing OpenCL kernels (${name})"
)

add_custom_target(GPGPU ALL DEPENDS "${CMAKE_CURRENT_LIST_DIR}/src/${OCL_NAME}.cpp" )
set(PV_GPU_ALGO_INC ${CMAKE_CURRENT_LIST_DIR}/include)
